// 外部状态
export const initialState = {
  film: {},
  list: [],
}

// 外部状态逻辑
export const reducer = (preState, { type, payload }) => {
  console.log('reducer', preState, type, payload)
  let state = { ...preState }
  switch (type) {
    case 'change-film':
      state.film = payload
      return state
    case 'change-list':
      state.list = payload
      return state
    default:
      return preState
  }
}
